﻿CREATE PROCEDURE [dbo].[Tournaments_SelectByLeagueIdBowlerId]
   @league_id uniqueidentifier,
   @bowler_id uniqueidentifier
AS
  SELECT [dbo].[Tournaments].[league_id],
         [dbo].[Tournaments].[tournament_name],
         [dbo].[Tournaments].[starts_on],
         [dbo].[Tournaments].[ends_on]
    FROM [dbo].[Tournaments]
         INNER JOIN [dbo].[Tournament_Members]
                    ON [dbo].[Tournaments].[league_id] = [dbo].[Tournament_Members].[league_id]
                       AND [dbo].[Tournaments].[tournament_name] = [dbo].[Tournament_Members].[tournament_name]
   WHERE [dbo].[Tournament_Members].[league_id] = @league_id
         AND [dbo].[Tournament_Members].[bowler_id] = @bowler_id


